package com.atguigu.crmservice.controller;

import com.atguigu.commentutils.R;
import com.atguigu.crmservice.entity.CrmBanner;
import com.atguigu.crmservice.service.CrmBannerService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Api(description = "前台用户管理")
@CrossOrigin
@RestController
@RequestMapping("/eduservice/bannerfront")
public class BannerFrontController {

    @Autowired
    private CrmBannerService bannerService;

    //查询所有banner
    @ApiOperation(value = "查询所有banner")
    @GetMapping("findAll")
    public R findAll(){
        List<CrmBanner> list = bannerService.selectAllBanner();
        return R.ok().data("list",list);
    }
}
